package com.zy.activity

import com.zy.zlog.ZLog.d
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.KeyEvent
import android.view.WindowManager
import android.view.MotionEvent
import androidx.fragment.app.Fragment

abstract class BaseActivity : AppCompatActivity() {

    override fun dispatchKeyEvent(event: KeyEvent): Boolean {
        d("BaseMainActivity", "dispatchKeyEvent:$event")
        return super.dispatchKeyEvent(event)
    }

    override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
        //ZLog.d("BaseMainActivity", "dispatchTouchEvent:" + ev);
        //ZLog.d("BaseMainActivity", "dispatchTouchEvent "+ev.getAction()+" 相对坐标:[" + ev.getX() + "," + ev.getY() + "] 绝对坐标:[" + ev.getRawX() + "," + ev.getRawY() + "]");
        return super.dispatchTouchEvent(ev)
    }

    override fun onTouchEvent(event: MotionEvent): Boolean {
        val result = super.onTouchEvent(event)
        d("BaseMainActivity", "onTouchEvent result:$result")
        return super.onTouchEvent(event)
    }
}